<cfcomponent output="false">
	
	<!--- --->

	<cffunction name="renderErrorDetail" access="public" output="true" returntype="string">
		<cfargument name="name" required="true" />
		<cfargument name="message" required="true" />
		<cfargument name="age" required="true" />
		<cfargument name="limit" required="false" default="10" />
		
		<cfset var local = {} />
		
		<cfset local.errors = $.run.it('logService.getLogs',arguments) />
		
		<cfsavecontent variable="local.result">
			<cfloop query="local.errors">
				<div class="errorType">
					<cfset local.date = $.date.applyLocalization(local.errors.created) />
					<div style="float:left;">
						<span style="color:##999999;">#$.format.humanizeDate(local.date)# - #$.format.humanizeTime(local.date)#
					</div>
					
					<!--- the offender --->
					<div class="offender">
						<cftry>
							<cfset local.session = evaluate(local.errors.session) />
							<cfif structKeyExists(local.session,"user") and structKeyExists(local.session.user,"name")>
								#local.session.user.name#
							<cfelse>
								nobody
							</cfif>	
							<cfcatch>
								problem with session struct
							</cfcatch>				
						</cftry>
					</div>
					<div style="clear:both;"></div>
					
					<!--- the message --->
					<div>
						<cftry>
							<cfset local.error = evaluate(local.errors.error) />
							<cfif structKeyExists(local.error,"message")>
								<span style="color:red;">#local.error.message#</span>
							<cfelse>
								no message
							</cfif>
							<cfcatch>
								problem with error struct
							</cfcatch>
						</cftry>
					</div>
					
					<!--- the toggle links --->
					<div>
						<a href="javascript:void(0);" onclick="javascript:Error.toggle(this,'cfcatchDump');">cfcatch</a>&nbsp;&nbsp;
						<a href="javascript:void(0);" onclick="javascript:Error.toggle(this,'argumentDump');">arguments</a>&nbsp;&nbsp;
						<a href="javascript:void(0);" onclick="javascript:Error.toggle(this,'sessionDump');">session</a>
					</div>
					<div class="cfcatchDump hidden">
						<cftry>
							<cfdump var="#evaluate(local.errors.error)#">
							<cfcatch>
								<cfdump var="#local.errors.error#">
							</cfcatch>
						</cftry>
					</div>
					<div class="argumentDump hidden">
						<cftry>
							<cfdump var="#evaluate(local.errors.arguments)#">
							<cfcatch>
								<cfdump var="#local.errors.arguments#">
							</cfcatch>
						</cftry>
					</div>
					<div class="sessionDump hidden">
						<cftry>
							<cfdump var="#evaluate(local.errors.session)#">
							<cfcatch>
								<cfdump var="#local.errors.session#">
							</cfcatch>
						</cftry>
					</div>
				</div>
			</cfloop>
		</cfsavecontent>
		
		<cfreturn $.render.clean(local.result) />
	</cffunction>
	
	<!--- --->

</cfcomponent>